#include "INode.h"

int getLeafCount(IRoot* root)
{
	int leafCount = 0;
	if (root)
	{
		root->visitChildren([&leafCount](const std::shared_ptr<INode>& node)
		{
			if (node->isLeaf())
				++leafCount;
		}, true);
	}
	return leafCount;
}
